Fix Caching strategy on form_post html#2294
Conversation
Fix Caching strategy on form_post html
|
Thanks for your PR! The That said, we'll definitely want to change it since the OAuth 2.0 specification explicitly require using https://datatracker.ietf.org/doc/html/rfc6749#section-5.1 Interestingly, the "OAuth 2.0 Form Post Response Mode" specification includes a (non-normative) appendix that uses https://openid.net/specs/oauth-v2-form-post-response-mode-1_0.html#FormPostResponseExample So, for compliance and consistency with the other code paths that also return the |
|
"MUST include" I think there is some room for interpretation here:
Hence one could argue that Hence it is included as required. Do you take this from here and change as required? Since it is such a simple change I'd argue it is not worth the back and forth. Just change it, no attribution required ;) PS: Thanks for the fast and deep research on this, good job! |
Yeah, it's not unreasonable, tho' it's not something the normative sample mentioned in the OAuth 2.0 specification does (e.g for the token response): HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Cache-Control: no-store
Pragma: no-cache
{
"access_token":"2YotnFZFEjr1zCsicMWpAA",
"token_type":"example",
"expires_in":3600,
"refresh_token":"tGzv3JOkF0XG5Qx2TlKWIA",
"example_parameter":"example_value"
}Same thing in the OIDC base specification: HTTP/1.1 200 OK
Content-Type: application/json
Cache-Control: no-store
{
"access_token": "SlAV32hkKG",
"token_type": "Bearer",
"refresh_token": "8xLOxBtZp8",
"expires_in": 3600,
"id_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6IjFlOWdkazcifQ.ewogImlzc
yI6ICJodHRwOi8vc2VydmVyLmV4YW1wbGUuY29tIiwKICJzdWIiOiAiMjQ4Mjg5
NzYxMDAxIiwKICJhdWQiOiAiczZCaGRSa3F0MyIsCiAibm9uY2UiOiAibi0wUzZ
fV3pBMk1qIiwKICJleHAiOiAxMzExMjgxOTcwLAogImlhdCI6IDEzMTEyODA5Nz
AKfQ.ggW8hZ1EuVLuxNuuIJKX_V8a_OMXzR0EHR9R6jgdqrOOF4daGU96Sr_P6q
Jp6IcmD3HP99Obi1PRs-cwh3LO-p146waJ8IhehcwL7F09JdijmBqkvPeB2T9CJ
NqeGpe-gccMg4vfKjkM8FcGvnzZUN4_KSP0aAp1tOJ1zZwgjxqGByKHiOtX7Tpd
QyHE5lcMiKPXfEIQILVq0pc_E2DzL7emopWoaoZTF_m0_N0YzFC6g6EJbOEoRoS
K5hoDalrcvRYLSrQAZZKflyuVCyixEoV9GfNQC3_osjzw2PAithfubEEBLuVVk4
XUVrWOLrLl0nx7RkKU8NXNHq-rvKMzqg"
}https://openid.net/specs/openid-connect-core-1_0.html#TokenResponse I guess it would be safer not to be too creative here and just use
Haha nah, let's continue with your PR: as you said the change should be minimal and it's always better when proper credits are attributed! 👍🏻 |
src/OpenIddict.Server.AspNetCore/OpenIddictServerAspNetCoreHandlers.Authentication.cs
Outdated
Show resolved
Hide resolved
Change to no-store
|
There you go ;) |
|
Merged! Thanks for your contribution 😃 (I'll likely backport this change to the 6.x branch and make sure it's included in the 6.3 release). |
While this is kind of minor, we still wanted to fix this caching issue and contribute it back to here.
In the mean time we already changed to a custom handler.
This issue was found in an audit of our system.